//
//  HomeOwnViewModel.swift
//  imprint
//
//  Created by 小柠檬🍋 on 2025/2/3.
//

import Foundation
import SwiftUI
class AiCustomItemViewModel : BaseViewModel {
    
    
    override init() {
        super.init()
        self.addObserve(self, .refreshCustomItem) { (selfInstance, bean: Bool) in
            selfInstance.doRefreshTag2()
        }
    }
    
    @Published var refreshTag = 0
    
    
    func doRefreshTag() {
        //发送刷新通知，为啥要用通知，因为如果是替换的话，其他item也要刷新
        NotificationCenter.default.post(name: .refreshCustomItem, object: true)
    }
    
    private func doRefreshTag2() {
        refreshTag = refreshTag + 1
    }
}
